<!--
 * @Description: 
 * @Author: 赵华宇
 * @Date: 2025-04-27 19:36:41
 * @LastEditors: 赵华宇
 * @LastEditTime: 2025-04-28 09:45:55
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>双开门</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        /* 1.布局：父子结构 父级是大图，子级是 左右小图*/
        .father{
            display: flex;
            margin: 0 auto;
            width: 1226px;
            height: 600px;
            background-image: url(./images/bg.jpg);
            overflow: hidden;

        }
        .father .left,
        .father .right{
            width: 50%;
            height: 600px;
            background-image: url(./images/1.jpg);
            background-repeat: no-repeat;
            transition: all 5s;
        }
        /* right 表示的取到精灵图右边的图 */
        .father .right{
            background-position: right 0;
        }

        /* 2.鼠标悬停效果 左右移动 */
        .father:hover .left{
            transform: translateX(-100%);
        }
        .father:hover .right{
            transform: translateX(100%);
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="left"></div>
        <div class="right"></div>
    </div>
</body>
</html>